package com.cskaoyan.filter;

import org.springframework.web.filter.OncePerRequestFilter;

import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author stone
 * @date 2022/07/12 17:25
 */
public class CustomFilter extends OncePerRequestFilter {
    @Override
    protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
        // 这个方法里做的事情，和你之前在Filter接口里的doFilter做的事情一致
        System.out.println("filter doFilterInternal");
        filterChain.doFilter(httpServletRequest, httpServletResponse);
    }
}
